﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>EasyCRM</title>
    <link href="./css/ecrm02.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="./js/jquery5685.js"></script>
    <script type="text/javascript" src="./js/ecrm13027.js"></script>
    <script language="javascript">
        window.onload = emailFieldInit;

        function emailFieldInit() {
	        var email = "";
	        //if (document.cookie != "") {
		    //    email = document.cookie.split("=")[1];
	        //}
	        
	        email=getCookie("ecrmemail");

	        document.getElementById("email").value = email;
        }
        
        function getCookie(name){
              var strCookie=document.cookie;
              var arrCookie=strCookie.split("; ");
              for(var i=0;i<arrCookie.length;i++){
                    var arr=arrCookie[i].split("=");
                    if(arr[0]==name)return arr[1];
              }
              return "";
        }
        
        function addCookie(name,value,expireHours){
              var cookieString=name+"="+escape(value);
              //判断是否设置过期时间,0=永不过期
              if(expireHours>0){
                     var date=new Date();
                     date.setTime(date.getTime+expireHours*3600*1000);
                     cookieString=cookieString+"; expire="+date.toGMTString();
              }
              document.cookie=cookieString;
        }

        function deleteCookie(name){
               var date=new Date();
               date.setTime(date.getTime()-10000);
               document.cookie=name+"=v; expire="+date.toGMTString();
        }

        function setCookie() {
	        var expireDate = new Date();
	        expireDate.setMonth(expireDate.getMonth()+6);
        	
	        var email = document.getElementById("email").value;
	        document.cookie = "ecrmemail=" + email + ";expires=" + expireDate.toGMTString();
        }
        
        function saveCookie()
        {
            if(document.getElementById("remember").checked==true)
            {
                setCookie();
	            //var email = document.getElementById("email").value;
                
                //addCookie("ecrmemail",email,10);???????
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" class="fastreg pl">
        <div>
        <div style="padding-left:50px;">
            <div id="tablerb">
                <h2>登录  · · · · · ·</h2>
                <table class="infobox">
                    <tr><td class="tablelt"></td><td class="tablect"></td><td class="tablert"></td></tr>
                    <tr><td class="tablelc"></td><td class="tablecc">
                        <div class="login_input">
                        <span class="m">Email: </span>
                            <asp:TextBox ID="email" runat="server"></asp:TextBox>
                        </div>
                        <div class="login_input" >
                        <span class="m">密&nbsp;&nbsp;&nbsp;码: </span><asp:TextBox ID="password" runat="server" TextMode="Password"></asp:TextBox>
                        </div>
                        <div class="login_end">
                        <input id="remember" name="remember" type="checkbox"/>&nbsp; <span style="color:#AAA;" class="pl">在这台电脑上记住我</span>
                            <div style="margin-top:.5em;">
                                <asp:Button ID="btnLogin" runat="server" Text="登录" Width="58px" OnClick="btnLogin_Click" />
                            <a style="float:right;margin-top:.5em;" href="./user/user_reback_pwd.aspx">忘记密码了</a>
                            </div>
                        </div>
                    </td><td class="tablerc"></td></tr>
                    <tr><td class="tablelb"></td><td class="tablecb"></td><td class="tablerb"></td></tr>
                </table>
                <p style="margin-bottom:34px;margin-top:15px"><a style="font-size:14px;color:#336797;" href="./user/user_reg.aspx" target="_blank">&gt;&gt; 立即注册</a></p>
            </div>
        </div>
        </div>
    </form>
</body>
</html>
